package com.xmsx.back.pojo;

import java.util.Objects;

public class Element {

    private String term;
    private int num;

    public Element() {
    }

    public Element(String term, int num) {
        this.term = term;
        this.num = num;
    }

    public String getTerm() {
        return term;
    }

    public void setTerm(String term) {
        this.term = term;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Element)) return false;
        Element element = (Element) o;
        return getNum() == element.getNum() &&
                Objects.equals(getTerm(), element.getTerm());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getTerm(), getNum());
    }

    @Override
    public String toString() {
        return "Element{" +
                "key='" + term + '\'' +
                ", value=" + num +
                '}';
    }
}
